package com.cbn.ibcp.jishiting.media.service.impl;

import com.cbn.ibcp.common.annotation.DataSource;
import com.cbn.ibcp.common.enums.DataSourceType;
import com.cbn.ibcp.jishiting.media.bo.EpisodeResourceStreamBO;
import com.cbn.ibcp.jishiting.media.mapper.EpisodeResourceStreamMapper;
import com.cbn.ibcp.jishiting.media.service.IEpisodeResourceStreamService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
@RequiredArgsConstructor
public class EpisodeResourceStreamServiceImpl implements IEpisodeResourceStreamService {

    private final EpisodeResourceStreamMapper episodeResourceStreamMapper;

    @DataSource(DataSourceType.ibcp_media)
    @Override
    public List<EpisodeResourceStreamBO> selectWithEpisodeList(EpisodeResourceStreamBO episodeResourceStreamBO) {
        if (episodeResourceStreamBO == null) {
            return null;
        }
        return episodeResourceStreamMapper.selectWithEpisodeList(episodeResourceStreamBO);
    }
}
